// (pos: Vector) => Color
interface Product {
   name: string;
   price: number;
}

// workFn的类型是入参为一个number 返回值是一个Product对象的函数
let workFn: (hours: number) => Product;
workFn = (h: number) => {
   return {
      name: "产品",
      price: 123,
   };
};

// eatFn 的类型是无参 无返回值的函数
let eatFn: (food: string) => void;
// 入参不需要用时可以不接受，但一旦接收，就必须顺序与类型完全比配
eatFn = () => {
   // 事实上 具体类型可以给void类型赋值
   // return "adsdsvds"
};

let actorsFormatter: (row: Object, column: Object, cellValue: any, index: number) => void;
let categoryFormatter: (row: Object, column: Object, cellValue: any, index: number) => void;

/* 给复杂函数类型起别名 */
type Formatter = (row: Object, column: Object, cellValue: any, index: number) => void;
const premierAtFormatter: Formatter = (row: Object, column: Object, cellValue: any, index: number) => {
   // do something...
};
